<style lang="scss" scoped>
.classify{
    padding: 10px 0; 
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    .item{
        padding: 10px;
        box-sizing: border-box;
        border:1px solid #eee;
        border-radius: 4px;
        width:224px;
        height: 275px;
        margin-bottom: 20px;
        text-align: center;
        img{
            display: block;
            margin:20px auto 10px ;
        }
        h5{
            width:150px;
            border-bottom: 1px solid #F0F0F0;
            margin:auto;
            font-size: 14px;
            color: #3D85FD;
            font-weight: bold;
            line-height: 40px;
            margin-bottom: 6px;
        }
        p{
            font-size: 10px;
            line-height: 26px;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            overflow: hidden;
        }
    }
    .item:hover{
        box-shadow: 0 0 5px 0 #008EFF;
    }
}
a:hover{
    text-decoration: none;
}

</style>
<template>
    <div class="classify">
        <router-link :to="{name:'classify_detail',query:{code:val.code}}" class="item" v-for="(val,index) in list" :key="index" v-show="list.length">
            <img :src="val.src">
            <h5>{{`第${val.code}类：${val.name}`}}</h5>
            <p>{{val.desp}}</p>
        </router-link>
    </div>
</template>
<script>
import {trademark} from "@/assets/api"
export default {
    data(){
        return {
            list:[]
        }
    },
    mounted(){
        trademark()
        .then(res=>{
            if(res){
                res.data.list.forEach((el,index)=>el.src=require(`@/assets/trademark_classify/icon${index+1 }.svg`))
                this.$nextTick(function(){
                    this.list=res.data.list
                })
            }
        })
    }
}
</script>